package com.example.zk.controller;

import com.example.zk.model.User;
import com.example.zk.service.UserService;
import com.example.zk.vo.Grid;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by it001 on 2018-12-19.
 */
@RestController
@RequestMapping("/admin/")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = "getUser",method = RequestMethod.GET)
    public User findOnd(Long id){

     return userService.find(id);
    }

    @RequiresPermissions("sys:user:view")
    @RequestMapping(value = "findList",method = RequestMethod.GET)
    public Grid findList(){
        return userService.findList();
    }


}
